#!/usr/bin/env php
<?php

/**

title=测试 fileModel->getImageSize();
cid=0

- 传入空对象。 @0
- 检查图片大小。
 -  @100
 - 属性1 @150
 - 属性mime @image/png
- 文件不存在。
 -  @0
 - 属性1 @0
 - 属性2 @png

*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
su('admin');

$imgFile    = dirname(__FILE__) . '/img.png';
$imgContent = base64_decode('iVBORw0KGgoAAAANSUhEUgAAAGQAAACWCAYAAAAouC1GAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAABjkSURBVHja7V0JcBTHuf5zYJtDO3uvQLuSkJ3KS/yc4FTiHH42uVxJKtezkyriOGBjm/uwibksQDu72p1dCRAgEYEwNwZjgTkM4jBgxGmMBRgFTEjwwy7bwU4gYA4ZgfD3qmd3VrOzM7uzQlqt0P5VX3VPb//df/c33X93z2hElJGMZCQjGclIRjKSkc4iH6Ar/R0P0gkMoRMoo3dQQydQTydwmk7gLJ1AI72DxnD8tPhbKE+ZqMN0WRkZuQk5ifvoONx0HLvoOBrpGCDiuCw8Lrs+liDOymBlnRDLvC/TwXrkBPLpGCbTMZykvwIxqNeZpgV5XlYHq4vVmRGFHMe9dBSrqR436Gi4446qoF4jHi9fIv1QnatFGzJEoA8dQQ29DURwRBbXSj8SJ//N6B9FDR1Bn85HxLvg6DDK6TCa6DCQZmgSbWM2dgp5Gw/TIZyhQwDVhXFIJTyU4Le212c2PnwrT0+3UR3K6SBAb4UhjytxUCNPqvXfQrlo+y0lh5FHb6KO3gQiOCiLx0vTQmr168Q23BJSh3voDXxEBwARb8hCKa5MV/6ulS+1+h+JbenQ8iYeoP04T/sBEfvCYUvR/vrnxTZ1SNmLB2gfGmgvoIp9qmk3aD/+TvuwmvZhGu2Hh/ZiHO3HCNqPibQfZbQPy2gfDtE+XNddbjL59iXUaxDb1qFkP+6hPThPewDaDUSFe2Ku/017UUn78CAdRXfddbC8e/BD2osK2otzUeXuVqlHu/7Y9MT658U2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JmzoObn6eKWtDuA9vbckzGf4o+oyIX7Ah12467HIYfOEpKXSjde3qdJq4UpfF9KF8asqzWk61FRFRNyPXtR8jhTqDsKVursW8qrdD54FhyEe8z0ZdKu28aQff0STHYPie05y1Js9quhKzv4js1M1n84xZZcyPUEZSOWrIlm3oPkDyfz1NhscyJGQkIxnJSEZuJfl/TJz4HnmKwaYAAAAASUVORK5CYII=');
file_put_contents($imgFile, $imgContent);

$file = new stdclass();
$file->realPath  = $imgFile;
$file->extension = 'png';

global $tester;
$fileModel = $tester->loadModel('file');
$fileModel->config->file->storageType = 'fs';

r($fileModel->getImageSize(new stdclass())) && p() && e('0'); //传入空对象。
r($fileModel->getImageSize($file))          && p('0,1,mime') && e('100,150,image/png'); //检查图片大小。

$file->realPath  = dirname(__FILE__) . '/img1.png';
r($fileModel->getImageSize($file)) && p('0,1,2') && e('0,0,png'); //文件不存在。

unlink($imgFile);
